<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const obj = {
      name: '崇宫澪',
      gender: '女',
      'my-husband': '真士'
    }
    // console.log(obj.name)

    // obj.age = 21 // 这样 新建变量名 可以 √
    // obj[hobby] = '约会' // 这样不行 x
    
    // console.log(obj.my-husband) // 错误写法

    console.log(obj['my-husband'])
  </script>
</body>
</html>